package com.hyl.interceptor;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import org.springframework.web.servlet.HandlerInterceptor;

/**
 * LoginInterceptor
 *
 * @author hyl
 * @date 2025-07-02
 */
public class UrlInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
       //获取请求的URL
        String requestURI = request.getRequestURI();
        //获取用户角色=》权限=》菜单
        HttpSession session = request.getSession();
        String role = (String) session.getAttribute("role");
        return true;
    }
}
